package designMode.singleTon;

/**
 * @program: jvm
 * @description      双重校验 获取单利  第一步   同步代码内判断  避免创建多个实例
 * @author: tkk fendoukaoziji
 * @create: 2019-03-13 09:34
 **/
public class LazySingle {
    private static volatile   LazySingle instance;
    private LazySingle(){

    }
    public  static LazySingle getInstance(){
        if(instance==null){
            synchronized (LazySingle.class){
                if (instance==null){
                    instance=new LazySingle();
                }
            }
        }
        return  instance;
    }
}
